package com.ali.service.impl;

import com.ali.common.BeanName;
import com.ali.service.UserService;
import spring.annotation.MyAutowired;
import spring.annotation.MyComponent;
import spring.service.MyBeanNameAware;
import spring.service.MyInitializingBean;

@MyComponent(BeanName.USER_SERVICE_IMPL)
public class UserServiceImpl implements MyBeanNameAware, MyInitializingBean, UserService {
    @MyAutowired
    private OrderServiceImpl orderServiceImpl;
    private String beanName;

    @Override
    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    @Override
    public void afterPropertiesSet() {
        System.out.println(BeanName.USER_SERVICE_IMPL + "初始化");
    }

    @Override
    public void test() {
        System.out.println(BeanName.ORDER_SERVICE_IMPL + "：" + orderServiceImpl);
        System.out.println("beanName：" + beanName);
    }
}
